// components/the-checkbox/index.js
import { virtualHostConfig } from '@/behavior/virtualHost'

Component({
  ...virtualHostConfig(),

  /**
   * 组件的属性列表
   */
  properties: {
    text: String,
    checked: Boolean,
    round: Boolean,
    size: {
      type: String,
      value: '36rpx'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onClick () {
      const { checked } = this.properties

      this.triggerEvent('change', { value: !checked })
    }
  }
})
